﻿Public Class SearchHotel
    Inherits System.Web.UI.Page
    Dim hotelPxy As New hotelService.HotelService
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnView_Click(sender As Object, e As EventArgs) Handles btnView.Click
        Dim ds As New DataSet
        ds = hotelPxy.getHotel("Philadelphia", "PA")
        ds.Tables(0).Columns(0).ColumnName = "HotelID"
        ds.Tables(0).Columns(1).ColumnName = "HotelName"
        ds.Tables(0).Columns(2).ColumnName = "City"
        ds.Tables(0).Columns(3).ColumnName = "State"
        ds.Tables(0).Columns(4).ColumnName = "ZipCode"
        ds.Tables(0).Columns(5).ColumnName = "Stars"
        ds.Tables(0).Columns(6).ColumnName = "RoomAvailability"
    End Sub



    Protected Sub btnSearchByCity_Click(sender As Object, e As EventArgs) Handles btnSearchByCity.Click

    End Sub

    Protected Sub btnSearchByAmenities_Click(sender As Object, e As EventArgs) Handles btnSearchByAmenities.Click
        Dim m_hotel As New hotelService.Hotel_t
        Dim arrayList As New ArrayList
        If chkAC.Checked Then
            m_hotel.AirConditioner = "True"
            arrayList.Add("AirCond")
        End If
        If chkBreakfast.Checked Then
            m_hotel.FreeBreakfast = "True"
            arrayList.Add("FreeBreakfast")
        End If
        If chkBusiness.Checked Then
            m_hotel.Business = "True"
            arrayList.Add("Business")
        End If
        If chkInternet.Checked Then
            m_hotel.Wifi = "True"
            arrayList.Add("Wifi")
        End If
        If chkParking.Checked Then
            m_hotel.Parking = "True"
            arrayList.Add("Parking")
        End If
        If chkPetAllowed.Checked Then
            m_hotel.Pet = "True"
            arrayList.Add("Pet")
        End If
        If chkRestaurant.Checked Then
            m_hotel.Restaurant = "True"
            arrayList.Add("Restuarant")
        End If
        If chkSmoking.Checked Then
            m_hotel.Smoking = "True"
            arrayList.Add("Smoking")
        End If
        If chkSpa.Checked Then
            m_hotel.Spa = "True"
            arrayList.Add("Spa")
        End If
        If chkSwimmingPool.Checked Then
            m_hotel.Swimming = "True"
            arrayList.Add("Swimming")
        End If


        gvAme.DataSource = hotelPxy.searchbyAmenities(arrayList.ToArray)
        gvAme.DataBind()


    End Sub
End Class